[#escape x as x?html]
<!DOCTYPE html>
<html>
<head>
	[#include "/include/meta.ftl" /] 
	[#include "/include/css.ftl" /]
	<title>图片新增</title> 
	[#include "/include/js.ftl" /]
</head>
<body class="hold-transition skin-blue sidebar-mini">
	<div class="wrapper">

		<div class="content-wrapper margin-left0">
			[#assign firstNavName="图片"]
			[#assign secondNavName="新增"]
			[#include "/include/contentHeader.ftl" /]

			<section class="content">
				<div class="box box-success">
					<form id="form" action="save" method="post" class="form-horizontal">
						<div class="box-body">
							<div class="form-group">
		                  		<label class="col-sm-2 control-label">所属图片位</label>
								<div class="col-sm-6">
									<select name="photoPositionId" class="form-control">
										[#list photoPositions as photoPosition]
									    <option value="${photoPosition.id}">${photoPosition.name}</option>
									    [/#list]
									</select>
								</div>
			                </div>
			                <div class="form-group">
		                  		<label class="col-sm-2 control-label">名称</label>
								<div class="col-sm-6">
								  <input type="text" name="name" class="form-control" placeholder="名称">
								</div>
			                </div>
			                <div class="form-group">
		                  		<label class="col-sm-2 control-label">显示文本</label>
								<div class="col-sm-6">
								  <input type="text" name="text" class="form-control" placeholder="显示文本">
								</div>
			                </div>
			                <div class="form-group">
		                  		<label class="col-sm-2 control-label">链接类型</label>
								<div class="col-sm-6">
									<select name="link.type" class="form-control selLinkType">
										[#list linkTypes as linkType]
									    <option value="${linkType}">${i18n("entity.link.Type."+linkType)}</option>
									    [/#list]
									</select>
								</div>
								<input type="hidden" name="link.data" class="inpLinkData"/>
			                </div>
			                <div class="form-group hidden divUrl">
		                  		<label class="col-sm-2 control-label">导航到url</label>
								<div class="col-sm-6">
								  <input type="text" class="form-control inpUrl" placeholder="导航url">
								</div>
			                </div>
			                <div class="form-group hidden divArticle">
		                  		<label class="col-sm-2 control-label">导航到文章</label>
								<div class="col-sm-6">
									<div class="input-group">
										<input type="hidden" class="inpArticleId"/>
								        <input type="text" class="form-control inpArticleTitle" placeholder="导航文章">
								        <span class="input-group-btn">
								        	<button type="button" class="btn btn-info btnChooseArticle">选择</button>
								        </span>
								    </div>
								</div>
			                </div>
			                <div class="form-group hidden divArticleClass">
		                  		<label class="col-sm-2 control-label">导航到文章分类</label>
								<div class="col-sm-6">
									<select class="form-control selArticleClassId">
										[#list articleClasses as articleClass]
									    <option value="${articleClass.id}">${articleClass.name}</option>
									    [/#list]
									</select>
								</div>
			                </div>
			                <div class="form-group">
		                  		<label class="col-sm-2 control-label">是否显示</label>
								<div class="col-sm-6">
								    <input type="checkbox" name="isDisplay" style="margin-top:10px;"/>
								    <input type="hidden" name="_isDisplay" value="false"/>
								</div>
			                </div>
			                <div class="form-group">
		                  		<label class="col-sm-2 control-label">是否新窗口打开</label>
								<div class="col-sm-6">
								    <input type="checkbox" name="isOpenNew" style="margin-top:10px;"/>
								    <input type="hidden" name="_isOpenNew" value="false"/>
								</div>
			                </div>
			                <div class="form-group">
	                            <label class="col-sm-2 control-label">图片</label>
	                            <div class="col-sm-6" id="uploadFile">
	                            	<input type="hidden" name="accessoryId" class="inpAccessoryId"/>
	                                <input type="file" name="file" id="imgFile"
	                                       accept="image/jpg,image/jpeg,image/png,image/gif">
	                            </div>
	                        </div>
	                        <div class="form-group" id="uploadedFile">
	                            <label class="col-sm-2 control-label">预览</label>
	                            <div class="col-sm-5">
	                                <img id="imgContent" width="400px"/>
	                            </div>
	                            <!-- <div class="col-sm-1">
	                                <button id="deletePhoto" type="button"
	                                        class="btn btn-block btn-danger" style="display: none;">删除照片
	                                </button>
	                            </div> -->
	                        </div>
						</div>
						<div class="box-footer">
							<div class="row">
								<div class="col-sm-offset-2">
		                			<button id="btnSubmit" type="button" class="btn btn-primary">保存</button>
								</div>
							</div>
		                </div>
					</form>
				</div>
			</section>
		</div>

	</div>
	
	<div id="modalArticle" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
	    <div class="modal-dialog modal-lg" role="document">
		    <div class="modal-content">
		    	<form id="formList" >
					<input type="hidden" name="pageNumber" value="1" />
					<input type="hidden" name="pageSize" value="20" />
					<input type="hidden" name="searchProperty" value="title" />
					<div class="box">
						<div class="box-header">
							<div id="searchBox" class="search-box">
								<div class="row form-inline" style="margin-left:0;">
									<div class="form-group">
									    <label >标题：</label>
									    <input type="text" name="searchValue" class="form-control" value="">
									</div>
									<button type="button" class="btn btn-info btnSearch"><i class="fa fa-search"></i></button>
								</div>
							</div>
						</div>
						<!-- /.box-header -->
						<div class="box-body padding-top0">
							
						</div>
						<!-- /.box-body -->
					</div>
					<!-- /.box -->
				</form>
		    </div>
	    </div>
	</div>
	
	<!-- ./wrapper -->
	<script type="text/javascript">
		require([ 'admin/js/photo/add'], function(Page) {
			Page.main();
			window.Page = Page;
		});
	</script>
</body>
</html>
[/#escape]
